package com.itheima.service;



import com.itheima.dao.OrderSettingdao;
import org.springframework.beans.factory.annotation.Autowired;



import java.text.SimpleDateFormat;
import java.util.Calendar;

//@Service
public class DeleteOrderSetting {
    @Autowired
    private OrderSettingdao orderSettingdao;

    public void delete() {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.MONTH, -1);
        orderSettingdao.delete(new SimpleDateFormat("yyyy.MM").format(calendar.getTime()));
    }

}
